package com.ggh.jinjilive.utils;

import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.ggh.jinjilive.BaseApplication;
import com.ggh.jinjilive.common.MerchantSession;
import com.ggh.jinjilive.listener.AddOnClickListener;
import com.ggh.jinjilive.listener.AddOnClickListener1;
import com.ggh.jinjilive.mobile.CommonMobile;
import com.ggh.jinjilive.mobile.Pay.WeChatPayMobile;
import com.ggh.jinjilive.mobile.ResultEntity;
import com.ggh.jinjilive.mobile.UserMobile;
import com.ggh.jinjilive.mobile.home.video.VideoDetails;
import com.ggh.jinjilive.mobile.live.GiftEntityMobile;
import com.ggh.jinjilive.mobile.live.MusicList;
import com.ggh.jinjilive.mobile.live.SellGoodsMobile;
import com.ggh.jinjilive.mobile.live.SendGiftMobole;
import com.ggh.jinjilive.mobile.mall.MallGoods;
import com.ggh.jinjilive.mobile.mine.DiamondMobile;
import com.ggh.jinjilive.mobile.mine.LevelMobile;
import com.ggh.jinjilive.mobile.mine.personal.DressUpDataMobile;
import com.ggh.jinjilive.mobile.mine.personal.PersonalDataMobile;
import com.ggh.jinjilive.mobile.mine.ranking.RankingBangModel;
import com.ggh.jinjilive.mobile.mine.video.PersonalVideoList;
import com.ggh.jinjilive.mobile.mine.zhubo.InvitationShareModel;
import com.ggh.jinjilive.remotedata.InterceptObserver;
import com.zhy.http.okhttp.OkHttpUtils;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

public class GeneralUtils {
    private static int page = 1;
    /**
     * 更新地图经纬度
     * @param map
     */
    public static void newUpdateMap(Map<String, Object> map){
        Observable<ResultEntity<String>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().newUpdateMap(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<String>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                LogUtils.d("更新成功");
            }

            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 获取用户数据
     * @param user_id
     */
    public static void mydata(String user_id){
        Map<String, Object> map = new HashMap<>();
        map.put("user_id",user_id);
        Observable<ResultEntity<UserMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().mydata(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<String>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                UserMobile userMobile = (UserMobile) resultEntity.getData();
                MerchantSession.getInstance().setUser(userMobile);
            }

            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 获取用户数据
     * @param user_id
     */
    public static void mydata(String user_id, AddOnClickListener addOnClickListener){
        Map<String, Object> map = new HashMap<>();
        map.put("user_id",user_id);
        Observable<ResultEntity<UserMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().mydata(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<String>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                UserMobile userMobile = (UserMobile) resultEntity.getData();
                MerchantSession.getInstance().setUser(userMobile);
                addOnClickListener.onSkipClicked("刷新");
            }

            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 签到
     */
    public static void signIn(){
        Observable<ResultEntity<Object>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().signIn();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<Object>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                ToastUtils.make().show(resultEntity.getMsg());
            }

            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }
    /**
     * 获取音乐列表
     */
    public static void songList(String keywords, boolean isRefresh, AddOnClickListener1 addOnClickListener1){
        if (isRefresh) {
            page = 1;
        }else {
            page = page + 1;
        }
        Map<String, Object> map = new HashMap<>();
        map.put("keywords",keywords);
        map.put("limit",20);
        map.put("page",page);
        Observable<ResultEntity<List<MusicList>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().songList(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<List<MusicList>>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }

            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 获取音乐地址
     * @param sid
     */
    public static void playSong(int sid, AddOnClickListener1 addOnClickListener1){
        Map<String, Object> map = new HashMap<>();
        map.put("sid",sid);
        Observable<ResultEntity<String>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().playSong(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<String>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }

            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }


    /**
     * 获取礼物列表
     * @param addOnClickListener1
     */
    public static void giftlist(AddOnClickListener1 addOnClickListener1){
        Map<String, Object> map = new HashMap<>();
        map.put("type",2);
        Observable<ResultEntity<GiftEntityMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().giftlist(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<SellGoodsMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 直播间发送礼物
     * @param map
     * @param addOnClickListener1
     */
    public static void givingGift(Map<String, Object> map,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<SendGiftMobole>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().givingGift(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<SendGiftMobole>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }


    /**
     * 获取视频详情
     * @param video_id
     * @param addOnClickListener1
     */
    public static void videoView(int video_id,AddOnClickListener1 addOnClickListener1){
        Map<String, Object> map = new HashMap<>();
        map.put("video_id",video_id);
        Observable<ResultEntity<VideoDetails>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().videoView(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<VideoDetails>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 视频 点赞
     * @param video_id
     * @param addOnClickListener1
     */
    public static void videoTop(int video_id,AddOnClickListener1 addOnClickListener1){
        Map<String, Object> map = new HashMap<>();
        map.put("video_id",video_id);
        Observable<ResultEntity<VideoDetails>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().videoTop(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<VideoDetails>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {
            }
        });
    }

    /**
     * 更新购物车数量
     * @param id 商品ID
     * @param num 数量
     */
    public static void editCartNumber(int id,int num){
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("num",num);
        Observable<ResultEntity<Object>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().editCartNumber(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<Object>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {

            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 店铺状态
     * @param addOnClickListener1
     */
    public static void checkStoreStatus(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().checkStoreStatus();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }


    /**
     * 获取店铺的商品
     * @param map
     * @param addOnClickListener1
     */
    public static void shopProductList(Map<String, Object> map,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<MallGoods>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().shopProductList(map);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<List<MallGoods>>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }


    /**
     * 社区公约
     */
    public static void agreementCommunity(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementCommunity();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 隐私政策
     */
    public static void agreementPrivacy(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementPrivacy();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 服务条例
     */
    public static void agreementService(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementService();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 联系我们
     */
    public static void agreementContactus(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementContactus();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 主播协议
     */
    public static void agreementAnchor(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementAnchor();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 法律法规
     */
    public static void agreementLaw(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementLaw();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 市场规范
     */
    public static void agreementMarket(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementMarket();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 开店入驻协议
     */
    public static void agreementShop(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().agreementShop();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                if(null != addOnClickListener1){
                    addOnClickListener1.onSkipClicked(resultEntity.getData());
                }
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 生日修改
     */
    public static void infoSavebirthday(Map<String, Object> params){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoSavebirthday(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                ToastUtils.make().show(resultEntity.getMsg());
                GeneralUtils.mydata(MerchantSession.getInstance().getUser().getUser_id());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 上传图片
     * @param path
     * @param addOnClickListener1
     */
    public static void uploadimages(String path, AddOnClickListener1 addOnClickListener1){
        File file = new File(path);
        RequestBody fileRequestBody = RequestBody.create(MediaType.parse("multipart/form-data"),file);
        MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), fileRequestBody);
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().uploadimages(body);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                CommonMobile commonMobile = (CommonMobile) resultEntity.getData();
                addOnClickListener1.onSkipClicked(commonMobile.getUrl());

            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {
                ToastUtils.make().show(netMsg);
            }
        });
    }
    /**
     * 修改图片
     * @param params
     */
    public static void infoSaveheadportrait(Map<String, Object> params){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoSaveheadportrait(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                ToastUtils.make().show(resultEntity.getMsg());
                GeneralUtils.mydata(MerchantSession.getInstance().getUser().getUser_id());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 头像框
     * @param params
     */
    public static void infoFrameList(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<DressUpDataMobile>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoFrameList(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<List<DressUpDataMobile>>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 购买装扮和使用
     * @param params
     * @param addOnClickListener1
     */
    public static void infoSaveFrame(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoSaveFrame(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getMsg());
                GeneralUtils.mydata(MerchantSession.getInstance().getUser().getUser_id());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 生成会员充值订单
     */
    public static void myBuyVip(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().myBuyVip(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 微信支付
     * @param params
     * @param addOnClickListener1
     */
    public static void WeChatMyPay(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<WeChatPayMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().WeChatMyPay(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<WeChatPayMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 支付宝支付
     * @param params
     * @param addOnClickListener1
     */
    public static void alipayMyPay(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<String>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().alipayMyPay(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<String>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 获取钻石数量和数据列表
     * @param params
     * @param addOnClickListener1
     */
    public static void authBuylist(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().authBuylist(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 充值钻石获取订单
     * @param params
     * @param addOnClickListener1
     */
    public static void myBuyDiamond(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().myBuyDiamond(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 分享
     * @param addOnClickListener1
     */
    public static void infoShare(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<InvitationShareModel>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoShare();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<InvitationShareModel>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 获取排行榜列表
     * @param params
     * @param addOnClickListener1
     */
    public static void infoRankingList(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<RankingBangModel>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoRankingList(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<List<RankingBangModel>>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 改变关注状态
     * @param params
     * @param addOnClickListener1
     */
    public static void myFollow(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<PersonalDataMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().myFollow(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<PersonalDataMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 获取当前用户发布的视频
     * @param params
     * @param addOnClickListener1
     */
    public static void infoVideoList(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<PersonalVideoList>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoVideoList(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<List<PersonalVideoList>>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 私密
     * @param params
     * @param addOnClickListener1
     */
    public static void videoSetPrivate(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().videoSetPrivate(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 设置视频评论区是否可见
     * @param params
     * @param addOnClickListener1
     */
    public static void videoSetcomment(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().videoSetcomment(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 删除视频
     * @param params
     * @param addOnClickListener1
     */
    public static void infoDelVideo(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<CommonMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoDelVideo(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<CommonMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 主播等级
     */
    public static void authMyuserlevel(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<LevelMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().authMyuserlevel();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<LevelMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }
    /**
     * 用户等级
     */
    public static void authMyanchorlevel(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<LevelMobile>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().authMyanchorlevel();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<LevelMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 用户等级列表
     * @param addOnClickListener1
     */
    public static void otherUserlevellist(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<LevelMobile>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().otherUserlevellist();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<LevelMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 主播等级列表
     * @param addOnClickListener1
     */
    public static void otherAnchorlevellist(AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<LevelMobile>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().otherAnchorlevellist();
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<LevelMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }


    /**
     * 收到礼物明细
     * @param params
     * @param addOnClickListener1
     */
    public static void infoGiftDetail(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<DiamondMobile>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoGiftDetail(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<DiamondMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

    /**
     * 直播时长明细
     * @param params
     * @param addOnClickListener1
     */
    public static void infoLiveDetail(Map<String, Object> params,AddOnClickListener1 addOnClickListener1){
        Observable<ResultEntity<List<DiamondMobile>>> observable = BaseApplication.getInstance().getAppComponent().getSystemService().infoLiveDetail(params);
        observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new InterceptObserver<ResultEntity<DiamondMobile>>() {
            @Override
            public void onNextData(ResultEntity resultEntity) {
                addOnClickListener1.onSkipClicked(resultEntity.getData());
            }
            @Override
            public void onErrorNet(Throwable t, String netMsg) {

            }
        });
    }

}
